//package cn.wuyu.baselibrary.mvvm;
//
////import android.arch.lifecycle.ViewModelProviders;
//import android.support.annotation.NonNull;
//import android.support.v4.app.Fragment;
//import android.support.v4.app.FragmentActivity;
//
////import com.test.MyLiveDataToViewModel.ui.viewModel.BaseViewModel;
//
///**
// * 时间:2019/3/4
// * ----------------------
// * 描述:  绑定ViewModel帮助类
// */
//public class ViewModelUtils {
//
//    public static <T extends BaseViewModel> T of(@NonNull FragmentActivity activity, Class<T> modelClass) {
//        T t = ViewModelProviders.of(activity).get(modelClass);
//        t.setLifecycleOwner(activity);
//        return t;
//    }
//
//    public static <T extends BaseViewModel> T of(@NonNull Fragment activity, Class<T> modelClass) {
//        T t = ViewModelProviders.of(activity).get(modelClass);
//        t.setLifecycleOwner(activity);
//        return t;
//    }
//}
